This file is part of the supplementary material of the manuscript: Didino, D., Brandtner, M., & Knops, A. (2021). No influence of masked priming on the multiplication fact retrieval in a result verification task.

This script reports the analysis for experiment 2.

Dataset loaded: exp2_data.rds (data of result verification task)

Load libraries, my functions (my_functions folder) and data (data/processed folder):

library('ggpubr')
#> Loading required package: ggplot2
library('here')
#> here() starts at D:/mult_prime
library('kableExtra')
# library('knitr')
library('plotly')
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
library('ggridges')
library('tidyverse')
#> -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
#> v tibble  3.1.0     v dplyr   1.0.5
#> v tidyr   1.1.3     v stringr 1.4.0
#> v readr   1.4.0     v forcats 0.5.1
#> v purrr   0.3.4
#> -- Conflicts ------------------------------------------ tidyverse_conflicts() --
#> x dplyr::filter()     masks plotly::filter(), stats::filter()
#> x dplyr::group_rows() masks kableExtra::group_rows()
#> x dplyr::lag()        masks stats::lag()
library('BayesFactor')
#> Loading required package: coda
#> Loading required package: Matrix
#> 
#> Attaching package: 'Matrix'
#> The following objects are masked from 'package:tidyr':
#> 
#>     expand, pack, unpack
#> ************
#> Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
#> 
#> Type BFManual() to open the manual.
#> ************

# Load my functions
source(here('funcs', 'load_my_functions.R'))

# Load data
exp2 <- readRDS(here('data', 'processed', 'exp2_data.rds'))

Exclude outliers

exp2 <- 
  exp2 %>% 
  filter(outlier == FALSE)

Calculate delta RTs

exp2_dRT <- 
  exp2 %>% 
  return_delta_RT(.,
                  y_col = RT,
                  cols_to_group = c('sj', 'problem_size', 'SOA'),
                  cols_to_subtract = c('prime_cond'),
                  neutral_cond = 'neutral')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.

Delta RTs versus RTs

dens_RT <- 
  ggplot(exp2, aes(RT)) + 
  geom_density() +
  stat_function(fun = dnorm, 
                args = list(mean = mean(exp2$RT), sd = sd(exp2$RT)),
                color = 'blue') +
      ggtitle('')


dens_dRT <- 
  ggplot(exp2_dRT, aes(dRT)) + 
  geom_density() +
  stat_function(fun = dnorm, 
                args = list(mean = mean(exp2_dRT$dRT), sd = sd(exp2_dRT$dRT)),
                color = 'blue') +
      ggtitle('')
  
ggarrange(dens_RT,
          dens_dRT,
          ncol = 2,
          nrow = 1,
          labels = c('RT', 'delta RT'))

Delta RTs table

Table with RTs mean, standard deviation and standard error (aggregated on subject and condition):

# Calculate statistics
exp2_stats <- 
  exp2_dRT %>%
  return_stats(c('problem_size', 'SOA', 'cond'),
               DV = 'dRT')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
#> `summarise()` has grouped output by 'problem_size', 'SOA'. You can override using the `.groups` argument.

# Show results
exp2_stats %>% 
  make_table('Statistics (prime condition by problem size)')
Statistics (prime condition by problem size)
problem_size SOA cond N_sj Mean SD SE
large SOA_070 neigh_con 28 10.55 61.85 11.69
large SOA_070 neigh_inc 28 23.32 64.60 12.21
large SOA_070 unrel_con 28 5.29 49.72 9.40
large SOA_070 unrel_inc 28 16.80 81.24 15.35
large SOA_120 neigh_con 28 10.35 60.30 11.39
large SOA_120 neigh_inc 28 47.80 57.17 10.80
large SOA_120 unrel_con 28 13.15 61.29 11.58
large SOA_120 unrel_inc 28 35.58 60.79 11.49
large SOA_170 neigh_con 28 12.58 77.64 14.67
large SOA_170 neigh_inc 28 24.93 60.76 11.48
large SOA_170 unrel_con 28 5.39 71.40 13.49
large SOA_170 unrel_inc 28 28.90 67.85 12.82
small SOA_070 neigh_con 28 -1.18 39.70 7.50
small SOA_070 neigh_inc 28 16.52 50.88 9.61
small SOA_070 unrel_con 28 8.25 52.78 9.97
small SOA_070 unrel_inc 28 23.66 64.39 12.17
small SOA_120 neigh_con 28 -2.03 50.90 9.62
small SOA_120 neigh_inc 28 8.23 38.63 7.30
small SOA_120 unrel_con 28 -2.16 59.96 11.33
small SOA_120 unrel_inc 28 9.76 62.62 11.84
small SOA_170 neigh_con 28 31.51 52.51 9.92
small SOA_170 neigh_inc 28 24.55 52.07 9.84
small SOA_170 unrel_con 28 28.17 54.72 10.34
small SOA_170 unrel_inc 28 25.41 46.90 8.86

Delta RTs plots

RTs distribution across prime conditions:

plot_1 <-
  exp2_dRT %>% 
  ggplot(aes(dRT, fill = cond)) +
  geom_density(alpha = 0.6) +
  facet_wrap(~ SOA + problem_size, ncol = 2) +
  theme(panel.spacing = unit(2, "cm"))

ggplotly(plot_1)
exp2_dRT %>% 
  ggplot(aes(x = dRT, y = cond, fill = stat(x))) +
  geom_density_ridges_gradient(scale = 3) +
  scale_fill_viridis_c(name = 'RTs', option = 'C') +
  labs(y = 'Prime condition') +
  facet_wrap(~ SOA + problem_size, ncol = 2) 
#> Picking joint bandwidth of 26.6
#> Picking joint bandwidth of 18.9
#> Picking joint bandwidth of 20.7
#> Picking joint bandwidth of 15.8
#> Picking joint bandwidth of 27.2
#> Picking joint bandwidth of 22.5

Bayes factor

Bayes factors are computer with the package BayesFactor.

tribble(
  ~BF,      ~Evidence,
  '0-3',    'Anectodal',
  '3-10',   'Moderate',
  '10-30',  'Strong',
  '30-100', 'Very_strong',
  '>100',   'Decisive') %>% 
  make_table('Bayes factor interpretation')
Bayes factor interpretation
BF Evidence
0-3 Anectodal
3-10 Moderate
10-30 Strong
30-100 Very_strong
>100 Decisive
exp2_bf <- 
  exp2_dRT %>% 
  group_by(problem_size, SOA, cond) %>% 
  nest() %>% 
  mutate(
    # "DV" is the column with the means returned by "return_means()"
    BF_test = map(data,
                  ~ttestBF(x = .$dRT,
                           mu = 0)),
    BF_value = map(BF_test,
                   ~extractBF(.) %>% 
                     tibble %>% 
                     select(bf, error))
  ) %>% 
  unnest(BF_value)

exp2_bf
#> # A tibble: 24 x 7
#> # Groups:   problem_size, SOA, cond [24]
#>    problem_size SOA     cond      data              BF_test        bf      error
#>    <chr>        <chr>   <chr>     <list>            <list>      <dbl>      <dbl>
#>  1 large        SOA_070 neigh_con <tibble[,2] [28 ~ <BFBysFc~   0.291    1.58e-4
#>  2 large        SOA_070 neigh_inc <tibble[,2] [28 ~ <BFBysFc~   0.978    1.25e-7
#>  3 large        SOA_070 unrel_con <tibble[,2] [28 ~ <BFBysFc~   0.232    8.67e-5
#>  4 large        SOA_070 unrel_inc <tibble[,2] [28 ~ <BFBysFc~   0.345    2.03e-4
#>  5 large        SOA_120 neigh_con <tibble[,2] [28 ~ <BFBysFc~   0.292    1.60e-4
#>  6 large        SOA_120 neigh_inc <tibble[,2] [28 ~ <BFBysFc~ 191.       1.07e-7
#>  7 large        SOA_120 unrel_con <tibble[,2] [28 ~ <BFBysFc~   0.359    2.12e-4
#>  8 large        SOA_120 unrel_inc <tibble[,2] [28 ~ <BFBysFc~   9.05     1.35e-5
#>  9 large        SOA_170 neigh_con <tibble[,2] [28 ~ <BFBysFc~   0.280    1.48e-4
#> 10 large        SOA_170 neigh_inc <tibble[,2] [28 ~ <BFBysFc~   1.50     1.10e-7
#> # ... with 14 more rows

exp2_bf <- 
  exp2_bf %>%
  select(problem_size, SOA, cond, bf) %>% 
  rename(BF_10 = bf) %>% 
  mutate(
    BF_01 = 1 / BF_10
  ) 

# Show results
exp2_bf %>% 
  make_table('Bayes factor')
Bayes factor
problem_size SOA cond BF_10 BF_01
large SOA_070 neigh_con 0.29 3.44
large SOA_070 neigh_inc 0.98 1.02
large SOA_070 unrel_con 0.23 4.31
large SOA_070 unrel_inc 0.34 2.90
large SOA_120 neigh_con 0.29 3.43
large SOA_120 neigh_inc 191.02 0.01
large SOA_120 unrel_con 0.36 2.79
large SOA_120 unrel_inc 9.05 0.11
large SOA_170 neigh_con 0.28 3.57
large SOA_170 neigh_inc 1.50 0.67
large SOA_170 unrel_con 0.22 4.63
large SOA_170 unrel_inc 1.73 0.58
small SOA_070 neigh_con 0.20 4.93
small SOA_070 neigh_inc 0.73 1.36
small SOA_070 unrel_con 0.27 3.65
small SOA_070 unrel_inc 1.03 0.97
small SOA_120 neigh_con 0.20 4.89
small SOA_120 neigh_inc 0.36 2.81
small SOA_120 unrel_con 0.20 4.91
small SOA_120 unrel_inc 0.27 3.66
small SOA_170 neigh_con 10.72 0.09
small SOA_170 neigh_inc 2.69 0.37
small SOA_170 unrel_con 4.20 0.24
small SOA_170 unrel_inc 5.60 0.18

Plot dRT against mean RT (by subject)

Create a single data frame with dRT and mean RT (a data point for each subject, problem size and prime condition)

# Mean RT by subject
exp2_meanRT_sj <- 
  exp2 %>%
  return_stats(c('sj', 'problem_size', 'SOA', 'cond'),
               DV = 'RT') %>% 
  select(sj, problem_size, SOA, prime_cond, Mean) %>% 
  rename(cond = prime_cond) %>% 
  filter(cond != 'neutral')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.

# Join data frames
exp2_dRT_meanRT <- 
  full_join(exp2_dRT,
            exp2_meanRT_sj,
            by = c('sj', 'problem_size', 'SOA', 'cond'))

Plot for large problems

exp2_dRT_meanRT %>% 
  filter(problem_size == 'large') %>% 
  ggplot(aes(Mean, dRT)) +
  geom_point() +
  geom_hline(yintercept = 0,
             linetype = 'dashed',
             color = 'red',
             size = 0.5) +
  facet_wrap(~ cond + SOA, ncol = 3)

Plot for small problems

exp2_dRT_meanRT %>% 
  filter(problem_size == 'small') %>% 
  ggplot(aes(Mean, dRT)) +
  geom_point() +
  geom_hline(yintercept = 0,
             linetype = 'dashed',
             color = 'red',
             size = 0.5) +
  facet_wrap(~ cond + SOA, ncol = 3)

session information

xfun::session_info()
#> R version 4.0.5 (2021-03-31)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19044)
#> 
#> Locale:
#>   LC_COLLATE=English_United Kingdom.1252 
#>   LC_CTYPE=English_United Kingdom.1252   
#>   LC_MONETARY=English_United Kingdom.1252
#>   LC_NUMERIC=C                           
#>   LC_TIME=English_United Kingdom.1252    
#> 
#> Package version:
#>   abind_1.4-5              askpass_1.1              assertthat_0.2.1        
#>   backports_1.2.1          base64enc_0.1.3          BayesFactor_0.9.12-4.2  
#>   BH_1.75.0.0              blob_1.2.1               boot_1.3.27             
#>   broom_0.7.6              bslib_0.2.4              callr_3.6.0             
#>   car_3.0-10               carData_3.0-4            cellranger_1.1.0        
#>   cli_2.4.0                clipr_0.7.1              coda_0.19-4             
#>   colorspace_2.0-0         compiler_4.0.5           conquer_1.0.2           
#>   contfrac_1.1.12          corrplot_0.84            cowplot_1.1.1           
#>   cpp11_0.2.7              crayon_1.4.1             crosstalk_1.1.1         
#>   curl_4.3                 data.table_1.14.0        DBI_1.1.1               
#>   dbplyr_2.1.1             deSolve_1.28             digest_0.6.27           
#>   dplyr_1.0.5              dtplyr_1.1.0             ellipsis_0.3.1          
#>   elliptic_1.4.0           evaluate_0.14            fansi_0.4.2             
#>   farver_2.1.0             forcats_0.5.1            foreign_0.8-81          
#>   fs_1.5.0                 gargle_1.1.0             generics_0.1.0          
#>   ggplot2_3.3.5            ggpubr_0.4.0             ggrepel_0.9.1           
#>   ggridges_0.5.3           ggsci_2.9                ggsignif_0.6.1          
#>   glue_1.4.2               googledrive_1.0.1        googlesheets4_0.3.0     
#>   graphics_4.0.5           grDevices_4.0.5          grid_4.0.5              
#>   gridExtra_2.3            gtable_0.3.0             gtools_3.8.2            
#>   haven_2.3.1              here_1.0.1               highr_0.8               
#>   hms_1.0.0                htmltools_0.5.1.1        htmlwidgets_1.5.3       
#>   httr_1.4.2               hypergeo_1.2.13          ids_1.0.1               
#>   isoband_0.2.4            jquerylib_0.1.3          jsonlite_1.7.2          
#>   kableExtra_1.3.4         knitr_1.33               labeling_0.4.2          
#>   later_1.1.0.1            lattice_0.20-41          lazyeval_0.2.2          
#>   lifecycle_1.0.0          lme4_1.1.26              lubridate_1.7.10        
#>   magrittr_2.0.1           maptools_1.1.1           markdown_1.1            
#>   MASS_7.3.53.1            Matrix_1.3-2             MatrixModels_0.5-0      
#>   matrixStats_0.58.0       methods_4.0.5            mgcv_1.8.34             
#>   mime_0.10                minqa_1.2.4              modelr_0.1.8            
#>   munsell_0.5.0            mvtnorm_1.1-1            nlme_3.1.152            
#>   nloptr_1.2.2.2           nnet_7.3.15              numDeriv_2016.8.1.1     
#>   openssl_1.4.3            openxlsx_4.2.3           parallel_4.0.5          
#>   pbapply_1.4-3            pbkrtest_0.5.1           pillar_1.6.0            
#>   pkgconfig_2.0.3          plotly_4.9.3             plyr_1.8.6              
#>   polynom_1.4.0            prettyunits_1.1.1        processx_3.5.1          
#>   progress_1.2.2           promises_1.2.0.1         ps_1.6.0                
#>   purrr_0.3.4              quantreg_5.85            R6_2.5.0                
#>   rappdirs_0.3.3           RColorBrewer_1.1.2       Rcpp_1.0.6              
#>   RcppArmadillo_0.10.2.2.0 RcppEigen_0.3.3.9.1      readr_1.4.0             
#>   readxl_1.3.1             rematch_1.0.1            rematch2_2.1.2          
#>   reprex_2.0.0             rio_0.5.26               rlang_0.4.10            
#>   rmarkdown_2.7            rprojroot_2.0.2          rstatix_0.7.0           
#>   rstudioapi_0.13          rvest_1.0.0              sass_0.3.1              
#>   scales_1.1.1             selectr_0.4.2            sp_1.4.5                
#>   SparseM_1.81             splines_4.0.5            statmod_1.4.35          
#>   stats_4.0.5              stringi_1.5.3            stringr_1.4.0           
#>   svglite_2.0.0            sys_3.4                  systemfonts_1.0.2       
#>   tibble_3.1.0             tidyr_1.1.3              tidyselect_1.1.0        
#>   tidyverse_1.3.1          tinytex_0.31             tools_4.0.5             
#>   utf8_1.2.1               utils_4.0.5              uuid_0.1.4              
#>   vctrs_0.3.7              viridisLite_0.3.0        webshot_0.5.2           
#>   withr_2.4.1              xfun_0.22                xml2_1.3.2              
#>   yaml_2.2.1               zip_2.1.1